
<!doctype html>
<html>
<head>
    <meta charset="UTF-8">
    <title>智立云地板行业ERP</title>
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <link rel="stylesheet" href="../../assets/css/font.css">
    <link rel="stylesheet" href="../../assets/css/xadmin.css">
</head>
<body class="login-bg">

<div class="login">
    <div class="message">智立云地板行业ERP</div>
    <div id="darkbannerwrap"></div>
    <form method="post" class="layui-form">
        <input name="uuid" id="uuid" type="hidden"/>
        <input name="userName" placeholder="用户名" autocomplete="off"  type="text" lay-verify="userName" class="layui-input" >
        <hr class="hr15">
        <input name="passWord" lay-verify="password" placeholder="密码" autocomplete="off"  type="password" class="layui-input">
        <hr class="hr15">
        <input name="entCode" lay-verify="entCode" placeholder="组织号" autocomplete="off"  type="text" class="layui-input" value="sys">
        <hr class="hr15">
        <div  class="layui-inline">
            <div class="layui-input-inline">
                <input type="text" placeholder="验证码"  name="captcha" style="width:185px;" autocomplete="off" lay-verify="captcha"   class="layui-input">
            </div>
            <div class="layui-input-inline">
                <img  id="code">
            </div>

        </div>
        <hr class="hr15">
        <input value="登录" lay-submit lay-filter="login" style="width:100%;" type="submit">
        <hr class="hr20" >
    </form>
</div>
<script type="text/javascript" src="../../assets/js/lib.js"></script>


<script>

    lib.path("../../").use(['form','layer','jquery'], function () {
        var $ = layui.jquery;
        var form = layui.form;
        window.refreshCode = function (){
            var uuid=$.now();
            var url = SopConfig.url()+"/captcha.jpg?uuid="+uuid;
            $("#code").attr('src',url);
            $("#uuid").val(uuid);
        }
        refreshCode();
        form.verify({
            userName:function(v){
                if(v.trim()==''){
                    return "用户名不能为空";
                }
            }
            ,password:function(v){
                if(v.trim()==''){
                    return "密码不能为空";
                }
            },captcha:function(v){
                if(v.trim()==''){
                    return '验证码不能为空';
                }
            },entCode:function(v){
                if(v.trim()==''){
                    return '请输入组织号,平台默认sys';
                }
            }
        });
        //监听提交
        form.on('submit(login)', function (param) {
            common.ajax.post('sys/login',param.field,function(resp){
                common.util.setAccessToken(resp.token);
                window.location = '../../index.html';
            },function (err) {
                layer.msg(err.msg,{icon:5,shift:6})
                refreshCode();
            });
            return false;
        });

        $("#code").click(refreshCode).click().show();
        $('#code').on('mouseover',function(){
            layer.tips('点击刷新验证码', this,{time:1000});
        });



    })

    if (window != top)
        top.location.href = location.href;
</script>


<!-- 底部结束 -->
</body>
</html>
